﻿using System;
using System.Collections.Generic;

class BiggerThanTheNeighboursIndex
{
    static void BiggerThanNeighbours(int[] array)
    {
            int index = 1;
        while(array[index] <= array[index + 1] || array[index] <= array[index - 1])
        {
            index++;
            if (array[index] > array[index + 1] && array[index] > array[index - 1])
            {
                Console.WriteLine(index);
            }
           
        }
        
    }
    static void Main()
    {
        Console.WriteLine("Enter the length of the array:");
        int dimention = int.Parse(Console.ReadLine());
        int[] arrayOfInts = new int[dimention];
        for (int index = 0; index < arrayOfInts.Length; index++)
        {
            Console.WriteLine("Enter element {0}", index);
            arrayOfInts[index] = int.Parse(Console.ReadLine());
        }
        Console.Write("the first element which is bigger than it's neighbours is on index: ");
        BiggerThanNeighbours(arrayOfInts);
        
            
        
    }
}

